//1.0 导入相关包
import Vue from 'vue';
import vueRouter from 'vue-router'
import vueResource from 'vue-resource'

 

//1.0.2 导入mui相关的css
import '../statics/mui/css/mui.css';
import '../statics/mui/css/icons-extra.css'
//导入自定义全局样式，可以覆盖mint-ui和mui中的样式
import '../statics/css/site.css'
// import '../statics/mui/js/mui.min.js'


import mintUI from 'mint-ui'
Vue.use(mintUI);

//导入mint-ui的css
import 'mint-ui/lib/style.min.css';

//2.0 在Vue中加载vueRouter 
Vue.use(vueRouter);
Vue.use(vueResource);  //使用vueResource 对象才能自动在Vue对象实例上挂在一个$http

//2.0.1 在Vue上注册一个全局过滤器名称叫做 tolowercase1
Vue.filter('tolowercase',function(input){
	return input.toLowerCase() +'  ->from global';
});


//3.0 定义路由规则对象

import App from './App.vue'
import Home from './components/Home/Home.vue'
import Member from './components/Member/Member.vue'
import Shopcar from './components/Shopcar/Shopcar.vue'
import Search from './components/Search/Search.vue'
let router = new vueRouter({
	linkActiveClass:'mui-active',
	routes:[
		{name:'root',path:'/',redirect:'/Home'},//表示浏览器默认访问Home页
		{name:'Home',path:'/Home',component:Home},
		{name:'Member',path:'/Member',component:Member},
		{name:'Shopcar',path:'/Shopcar',component:Shopcar},
		{name:'Search',path:'/Search',component:Search}
	]
});

//4.0 使用router
new Vue({
	el:'#app',
	router,
	render:c=>c(App)
});